import { i18n } from '@/common/utils';
import { SelectionPickField2 } from '@/components/FieldTemplate/SelectionPickField2';
import { RJSFSchema, UiSchema } from '@rjsf/utils';
import { CollapseTemplate } from 'nextcae-base';

export const schema: RJSFSchema = {
  type: 'object',
  properties: {
    Selection: {
      title: i18n.t('Selection'),
      type: 'object',
      properties: {
        source: {
          title: i18n.t('Source'),
          type: 'array',
          ...{
            'x-options': ['face', 'solid'],
          },
        },
      },
    },
  },
};

export const uiSchema: UiSchema = {
  Selection: {
    'ui:FieldTemplate': CollapseTemplate,
    'ui:layout': [1, 2],
    'ui:options': {
      label: false, // 不显示 label
    },
    source: {
      'ui:field': SelectionPickField2,
      'ui:focused': true,
    },
  },
};
